using UnityEditor;
using QFramework;
using UnityEngine;
namespace ProjectSurvivor
{
    public interface IEnemy
    {
        public void Hurt(float value,bool force=false,bool critic=false);
        void SetHpScale(float hpScale);
        void SetSpeesScale(float speedScale);
        void SetHPScale(float speedScale);
    }
    public class DamageSystem: AbstractSystem, ICanSave
    {
        public static void CalculateDamage(float baseDamage, IEnemy enemy, int maxNormalDamage = 2
        , float criticalDamageTime = 5)
        {
            if (Random.Range(0, 1.0f) <= 0.5f)
            {
                enemy.Hurt((baseDamage + UnityEngine.Random.Range(2, criticalDamageTime)),false,true);

            }
            else
            {
                enemy.Hurt(baseDamage+UnityEngine.Random.Range(-1, maxNormalDamage));

            }
        }

        protected override void OnInit()
        {
            
        }
    }

    internal interface ICanSave
    {
    }
}